package com.kingtop.base.service.impl;

import java.time.LocalDateTime;

import javax.annotation.Resource;

import org.kingtop.mybatis.mapper.BaseServiceImpl;
import org.springframework.stereotype.Service;

import com.kingtop.base.dao.IBaseLogDao;
import com.kingtop.base.model.BaseLog;
import com.kingtop.base.service.IBaseLogService;


@Service("BaseLogService")
public class BaseLogServiceImpl extends BaseServiceImpl<BaseLog> implements IBaseLogService {

	@Resource
	private IBaseLogDao baseLogDao;

	@Override
	public void addLog(Long userId, String moduleType, String content, String userMessage,
			String ip, String className, String methodName) {
		BaseLog log = new BaseLog();
		log.setUserId(userId);
		log.setLogType(moduleType);
		log.setContent(content);
		log.setUserMessage(userMessage);
		log.setIp(ip);
		log.setClassName(className);
		log.setMethod(methodName);
		log.setCreateTime(LocalDateTime.now());
		this.baseLogDao.add(log);
	}


}